<template>
	<view>
		<view class="list-box flex justify-between" @click="$helper.to('/pages/views/realName/realName')">
			<view class="list-box-title">
				实名认证
			</view>
			<image src="/static/image/find/right.png" mode=""></image>
		</view>
		<view class="list-box flex justify-between" @click="$helper.to('/pages/views/login/userXy')">
			<view class="list-box-title">
				用户协议
			</view>
			<image src="/static/image/find/right.png" mode=""></image>
		</view>
		<view class="list-box flex justify-between" @click="$helper.to('/pages/views/login/userYs')">
			<view class="list-box-title">
				隐私政策
			</view>
			<image src="/static/image/find/right.png" mode=""></image>
		</view>
		<view class="list-box flex justify-between" @click="$refs.clear.open()">
			<view class="list-box-title">
				清除缓存
			</view>
			<image src="/static/image/find/right.png" mode=""></image>
		</view>
		<view class="list-box flex justify-between" @click="$helper.to('/pages/views/abouts/abouts')">
			<view class="list-box-title">
				关于我们
			</view>
			<image src="/static/image/find/right.png" mode=""></image>
		</view>
		<view class="submit-btn" @click="loginout">
			退出登录
		</view>
		<!-- 清除缓存 -->
		<uni-popup ref="clear" type="bottom" :mask-click="true" class="successPop">
			<view class="successBox">
				<view class="boxContent">
					<view class="tipsText">
						确认清楚缓存?
					</view>
					<view class="boxBotton flex justify-between">
						<view class="contactBtn" @tap="$refs.clear.close()">
							取消
						</view>
						<view class="suretBtn" @tap="clear()">
							确定
						</view>
					</view>
				</view>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		methods: {
			//关闭缓存
			clear() {
				uni.showLoading({
					title: '清理缓存中...'
				});
				setTimeout(() => {
					uni.showToast({
						title: '清理成功...'
					});
				}, 1000);
				setTimeout(() => {
					uni.hideLoading();
				}, 1500);
				this.$refs.clear.close();
			},
			loginout(){
				uni.showModal({
					title:'提示',
					content:'是否退出登录？',
					confirmColor:"#000000",
					cancelColor:"#999999",
					success:(res)=>{
						if(res.confirm){
							uni.clearStorageSync('user_token');
							uni.reLaunch({
								url:'/pages/views/login/login'
							})
						}
					}
				})
			},
		}
	}
</script>

<style scoped lang="scss">
	page {
		background-color: #fff;
	}

	.list-box {
		width: 95%;
		height: 100rpx;
		border-bottom: 1rpx solid #EFEFEF;
		padding: 25rpx;
		align-items: center;
		margin: 0 auto;

		.list-box-title {
			font-weight: 500;
			font-size: 30rpx;
			color: #000000;
		}

		image {
			width: 17rpx;
			height: 29rpx;
		}
	}

	.successPop {
		background-color: #FFFFFF;
		.successBox {
			width: 100%;
			height: 378rpx;
			background: rgba(255, 255, 255, 1);
			.boxContent {
				display: flex;
				flex-direction: column;
				align-items: center;

				.tipsText {
					width: 504rpx;
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: rgba(51, 51, 51, 1);
					text-align: center;
					margin-bottom: 58rpx;
					margin-top: 58rpx;
				}

				.boxBotton {
					width: 570rpx;
					font-size: 28rpx;
					font-weight: 400;
					text-align: center;

					.contactBtn {
						width: 260rpx;
						height: 80rpx;
						line-height: 80rpx;
						color: #999999;
						background: #EFEFEF;
					}

					.suretBtn {
						width: 260rpx;
						height: 80rpx;
						line-height: 80rpx;
						color: #FEC92F;
						background: #000000;
						border-radius: 12rpx;
					}
				}
			}
		}
	}
	.submit-btn{
		width: 686rpx;
		height: 88rpx;
		background: #000;
		color: #FEC92F;
		text-align: center;
		line-height: 88rpx;
		font-size: 32rpx;
		border-radius: 50rpx;
		position: absolute;
		bottom: 100rpx;
		left: 50%;
		transform: translate(-50%);
	}
</style>